Minor leak fixes.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sat, 3 Sep 2005 03:08:37 +0000 (03:08 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sat, 3 Sep 2005 03:08:37 +0000 (03:08 +0000)
gpsbabel/maggeo.c
gpsbabel/mkshort.c

index d6ec210e7ceaeb797673caea5134adda876736da..4cb016fed46b1af48340c22647d215a2f17c1aa4 100644 (file)
@@ -201,7 +201,7 @@ maggeo_waypt_pr(const waypoint *waypointp)
        if (cname) xfree(cname);
 
        maggeo_writemsg(obuf);
-
+       xfree(cname);
 }
 
 static void
index db5e0a45d4ee84ca32370020ad8d9d131369fb17..1a17c9928a899633d17649662c072ba36d775b06 100644 (file)
@@ -168,6 +168,7 @@ mkshort_del_handle(void *h)
                        xfree(s);
                }
        }
+       setshort_badchars(h, NULL);
        xfree(hdr);
 }
 
@@ -234,6 +235,9 @@ void
 setshort_badchars(void *h, const char *s)
 {
        mkshort_handle *hdl = h;
+
+       if ((hdl->badchars != NULL) && (hdl->badchars != DEFAULT_BADCHARS))
+               xfree(hdl->badchars);
        if (s == NULL) {
                hdl->badchars = DEFAULT_BADCHARS;
        } else {